import Vue from 'vue'
import Router from 'vue-router'
// import App from '../App'
const App = () => import('@/App')
const Main = () => import('@/pages/main')
const Discovery = () => import('@/pages/discovery')

const Sale = () => import('@/pages/sale')
const Search = () => import('@/pages/search')
const Home = () => import('@/pages/home')
const Relationlink = () => import('@/pages/relationlink')

const Shop = () => import('@/pages/shop')
const Profile = () => import('@/pages/profile')
const Profilearticle = () => import('@/pages/profilearticle')
const Profilesale = () => import('@/pages/profilesale')
const Profilenote = () => import('@/pages/profilenote')
const About = () => import('@/pages/about')
const Help = () => import('@/pages/help')

const Userpage = () => import('@/pages/userpage')
const Fansfollowslist = () => import('@/pages/fansfollowslist')
const Login = () => import('@/pages/login')
const Salefilter = () => import('@/pages/salefilter')
const Salelist = () => import('@/pages/salelist')
const Collectsalelist = () => import('@/pages/collectsalelist')
const Collectsalefullscreenlist = () => import('@/pages/collectsalefullscreenlist')
const Saledetail = () => import('@/pages/saledetail')
const Articlechannel = () => import('@/pages/articlechannel')
const Articlezcchannel = () => import('@/pages/articlezcchannel')
const Resoulist = () => import('@/pages/resoulist')
const Contentdetail = () => import('@/pages/contentdetail')
const Goodsdetail = () => import('@/pages/goodsdetail')
const Goodscollects = () => import('@/pages/goodscollects')

const Orderconfirm = () => import('@/pages/orderconfirm')
const OrderList = () => import('@/pages/orderlist')
const Orderdetail = () => import('@/pages/orderdetail')
const Addresslist = () => import('@/pages/addresslist')
const Newaddress = () => import('@/pages/newaddress')
const Notedetail = () => import('@/pages/notedetail')


const Downloadpage = () => import('@/pages/downloadpage')
const Testpush = () => import('@/pages/testpush')
const Testrepush = () => import('@/pages/testrepush')
const Testmypush = () => import('@/pages/testmypush')


const Test = () => import('@/pages/test')

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: "/",
      component: App,
      children: [
        {
          path: '/',
          name: 'main',
          component: Main,
          children: [
            // {
            //   path: '/',
            //   name: 'discovery',
            //   component: Discovery
            // },
            {
              path: '/',
              name: 'home',
              component: Home
            },
            {
              path: '/relationlink',
              name: 'relationlink',
              component: Relationlink
            },
            {
              path: '/shop',
              name: 'shop',
              component: Shop
            },
            {
              path: '/profile',
              name: 'profile',
              component: Profile
            }
          ]
        },
        {
          path: '/login',
          name: 'login',
          component: Login
        },
        {
          path: '/about',
          name: 'about',
          component: About
        },
        {
          path: '/help',
          name: 'help',
          component: Help
        },
        {
          path: '/userpage',
          name: 'userpage',
          component: Userpage
        },
        {
          path: '/fansfollowslist',
          name: 'fansfollowslist',
          component: Fansfollowslist
        },
        {
          path: '/search',
          name: 'search',
          component: Search
        },
        {
          path: '/sale',
          name: 'sale',
          component: Sale
        },
        {
          path: '/profilearticle',
          name: 'profilearticle',
          component: Profilearticle
        },
        {
          path: '/profilenote',
          name: 'profilenote',
          component: Profilenote
        },
        {
          path: '/profilesale',
          name: 'profilesale',
          component: Profilesale
        },
        {
          path: '/articlechannel',
          name: 'articlechannel',
          component: Articlechannel
        },
        {
          path: '/articlezcchannel',
          name: 'articlezcchannel',
          component: Articlezcchannel
        },

        {
          path: '/resoulist',
          name: 'resoulist',
          component: Resoulist
        },
        {
          path: '/contentdetail',
          name: 'contentdetail',
          component: Contentdetail
        },
        {
          path: '/saledetail',
          name: 'saledetail',
          component: Saledetail
        },
        {
          path: '/salefilter',
          name: 'salefilter',
          component: Salefilter
        },
        {
          path: '/salelist',
          name: 'salelist',
          component: Salelist
        },
        {
          path: '/collectsalelist',
          name: 'collectsalelist',
          component: Collectsalelist
        },
        {
          path: '/collectsalefullscreenlist',
          name: 'collectsalefullscreenlist',
          component: Collectsalefullscreenlist
        },
        {
          path: '/goodsdetail',
          name: 'goodsdetail',
          component: Goodsdetail
        },
        {
          path: '/goodscollects',
          name: 'goodscollects',
          component: Goodscollects
        },
        {
          path: '/orderconfirm',
          name: 'orderconfirm',
          component: Orderconfirm
        },
        {
          path: '/orderlist',
          name: 'orderlist',
          component: OrderList
        },
        {
          path: '/orderdetail',
          name: 'orderdetail',
          component: Orderdetail
        },
        {
          path: '/addresslist',
          name: 'addresslist',
          component: Addresslist
        },
        {
          path: '/newaddress',
          name: 'newaddress',
          component: Newaddress
        },
        {
          path: '/notedetail',
          name: 'notedetail',
          component: Notedetail
        },
        {
          path: '/downloadpage',
          name: 'downloadpage',
          component: Downloadpage
        },

        {
          path: '/test',
          name: 'test',
          component: Test
        },

        {
          path: '/testpush',
          name: 'testpush',
          component: Testpush
        },
        {
          path: '/testrepush',
          name: 'testrepush',
          component: Testrepush
        },
        {
          path: '/testmypush',
          name: 'testmypush',
          component: Testmypush
        },
        {
          path: '*', // 其他页面
          redirect: '/'
        }]
    }
  ]
})
